<script type="text/javascript">
function getElementByClass(className, parent) {
  parent || (parent = document);
  var descendants= parent.getElementsByTagName('*'), i=-1, e, result=[];
  while (e=descendants[++i]) {
    ((' '+(e['class']||e.className)+' ').indexOf(' '+className+' ') > -1) && result.push(e);
  }
  return result;
}

$(document).ready(function() {
    $('#example').dataTable({
					"bInfo": true,
					"bFilter": true,
					"bSort": true,
					//"sScrollY": "400px",
					"bPaginate": false,
					//"bScrollCollapse": true,
					"bLengthChange": false,
					//"bAutoWidth": false,
					"bJQueryUI": false,
				"aoColumnDefs": [ {
                "sClass": "centered",
                "aTargets": [ 0,2,3 ]
        }, { 'bSortable': false, 'aTargets': [ 3 ] }
		]
    } );
} );

</script>
<script type="text/javascript">
 $(document).ready(function(){
  tampil_data(0,0,0,0); 
  pilih_pages();
  $("#1").css({'background-color' : '#006699'}); //agar paging button bagian pertama berubah warna, karena page 1 yang pertama di jalankan
 });
 //untuk memunculkan animasi loading
 //sebulumnya properti class loading sudah di set display:none
 function show_loader(){
  $(".loading").fadeIn(200);
 }
 //menghilangkan animasi loading
 function hide_loader(){
  $(".loading").fadeOut(200);
 }
 //menampilkan data
 function tampil_data(pages,bulan,tanggal,nama_hari){
  show_loader();
  $("#tampil_data").load("<?=base_url()?>/produksi/tampil_data/" + pages + "/" + bulan + "/" + tanggal + "/" + ++nama_hari, hide_loader);
 }
 function pilih_pages(){
  $(".next").click(function(){
   var pages = this.id;
   var bulan = document.getElementById("bulan").innerHTML;
   var tanggal = document.getElementById("tanggal").innerHTML;
   var nama_hari = document.getElementById("nama_hari").innerHTML;
   tampil_data(pages,bulan,tanggal,nama_hari);
   return false;
  });
  
  $(".prev").click(function(){
   var pages = this.id; 
   var bulan = document.getElementById("bulan").innerHTML;
   var tanggal = document.getElementById("tanggal").innerHTML;
   var nama_hari = document.getElementById("nama_hari").innerHTML;
   tampil_data(pages,bulan,tanggal,nama_hari);
   return false;
  });
 }
</script>
<script>
var myMessages = ['info','warning','error','success']; // define the messages types		 
function hideAllMessages()
{
		 var messagesHeights = new Array(); // this array will store height for each
	 
		 for (i=0; i<myMessages.length; i++)
		 {
				  messagesHeights[i] = $('.' + myMessages[i]).outerHeight();
				  $('.' + myMessages[i]).css('top', -messagesHeights[i]); //move element outside viewport	  
		 }
}

function showMessage(type)
{
	$('.'+ type +'-trigger').click(function(){
		  hideAllMessages();				  
		  $('.'+type).animate({top:"100"}, 500);
	});
}

$(document).ready(function(){
		 
		 // Initially, hide them all
		 hideAllMessages();
		 
		 // Show message
		 for(var i=0;i<myMessages.length;i++)
		 {
			showMessage(myMessages[i]);
		 }
		 
		 // When message is clicked, hide it
		 $('.message').click(function(){			  
				  $(this).animate({top: -$(this).outerHeight()}, 500);
		  });		 
		 
});       
</script>
                <!-- Build page from here: -->
                <div class="row-fluid">
                    <div class="span12">
						<div class="success message">
							<p><?php echo $notif; ?></p>

</div>
					<?php if($notif != NULL){ ?>
					<script>
					$(document).ready(function(){
							  $('.success').animate({top:"110"}, 500);
							  	self.setInterval(function(){$('.success').animate({top: -$(this).outerHeight()}, 500)},2000);
							 });

					</script>
					<?php } ?>
					<div class="shortcuts">
					</div>
						<fieldset>					
							<div id="tampil_data"></div><!--Menampilkan kalender-->
							<div id="paging_button">
								<ul class="paging">
									<?php $i=0;?>
									<li id="-1" class="prev">Prev</li>
									<li id="1" class="next">Next</li>
								</ul>
							</div>
						</fieldset>
					</div><!-- End .span8 -->						
                </div><!-- End .row-fluid -->